using System;
using System.Data;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class GridViewPage : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
         if(!IsPostBack)
            LoadData();              
    }
    void LoadData( )
    {
        string connectionString =
        WebConfigurationManager.ConnectionStrings[
        "RCVDB2000"].ConnectionString;

        ControlHelper cls = new
        ControlHelper(connectionString);
        cls.CommandText = 
        "select CompanyName," +
        "ContactName, Address  from " +
        "tblRCAccounts where ProvinceID=@ProvinceID";
        cls.CommandType = CommandType.Text;
        cls.ParameterCollection =
        new string[1] { "@ProvinceID" };
        cls.ValueCollection = new string[1] { "2" };
        cls.InitProperties();
        cls.FillDataTableToGridView(GridView1); 
    }
     
}
